<template>
  <div class="hello">

      <div>这是父组件的parentArray：{{counter}}</div>

      <button type="button" @click="changeArray">
          点击我改变父元素的parentArray</button>


      <child-a :child-array="counter"></child-a>

  </div>
</template>

<script>
import ChildA from "./childA";
export default {
  name: 'ParentA',
    components: {ChildA},
    data () {
        return {
            counter: []
        }
    },
    methods: {
        changeArray () {
            const data={
                a:1,
                b:2
            }
            this.counter.push(data)
        }
    }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
